﻿using System;

namespace OOP
{
    class InterfaceDemo1
    {
        //static void Main(string[] args)
        //{
        //    Vehicle car = new Car();
        //    car.Fill();
        //    car.Run();
        //    car.Stop(); 
        //}
    }

    //使用接口实现交通工具
    interface IVehicle
    {
        void Fill();
        void Run();
        void Stop();
    }

    abstract class Vehicle : IVehicle
    {
        public void Fill()
        {
            Console.WriteLine("Pay and fill...");
        }

        abstract public void Run();

        public void Stop()
        {
            Console.WriteLine("Stoping!!");
        }
    }

    class Car : Vehicle
    {
        public override void Run()
        {
            Console.WriteLine("Car is runnig...");
        }
    }

    class Trunk : Vehicle
    {
        public override void Run()
        {
            Console.WriteLine("Trunk is running...");
        }
    }
}
